const maxArea = (height: Array<number>): number => {
	let max = 0

	let left = 0,
		right = height.length - 1

	while (left < right) {
		let cur = (right - left) * Math.min(height[left], height[right])
		max = Math.max(max, cur)

		height[left] < height[right] ? left++ : right--
	}

	return max
}
